/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package org.app.model.entities;

import java.io.Serializable;
import javax.persistence.*;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author Santiago
 */
@Entity
@Table(name = "jmb_users")
@XmlRootElement
@NamedQueries({
  @NamedQuery(name = "JmbUsers.findAll", query = "SELECT j FROM JmbUsers j"),
  @NamedQuery(name = "JmbUsers.findByUserMail", query = "SELECT j FROM JmbUsers j WHERE j.userMail = :userMail"),
  @NamedQuery(name = "JmbUsers.findByUserJnick", query = "SELECT j FROM JmbUsers j WHERE j.userJnick = :userJnick"),
  @NamedQuery(name = "JmbUsers.findByUserPassword", query = "SELECT j FROM JmbUsers j WHERE j.userPassword = :userPassword"),
  @NamedQuery(name = "JmbUsers.findByUserEnabled", query = "SELECT j FROM JmbUsers j WHERE j.userEnabled = :userEnabled"),
  @NamedQuery(name = "JmbUsers.findByUserBeans", query = "SELECT j FROM JmbUsers j WHERE j.userBeans = :userBeans")})
public class JmbUsers implements Serializable {
  private static final long serialVersionUID = 1L;
  @Id
  @Basic(optional = false)
  @NotNull
  @Size(min = 1, max = 60)
  @Column(name = "user_mail")
  private String userMail;
  @Size(max = 50)
  @Column(name = "user_jnick")
  private String userJnick;
  @Size(max = 32)
  @Column(name = "user_password")
  private String userPassword;
  @Column(name = "user_enabled")
  private Boolean userEnabled;
  @Column(name = "user_beans")
  private Integer userBeans;

  public JmbUsers() {
  }

  public JmbUsers(String userMail) {
    this.userMail = userMail;
  }

  public String getUserMail() {
    return userMail;
  }

  public void setUserMail(String userMail) {
    this.userMail = userMail;
  }

  public String getUserJnick() {
    return userJnick;
  }

  public void setUserJnick(String userJnick) {
    this.userJnick = userJnick;
  }

  public String getUserPassword() {
    return userPassword;
  }

  public void setUserPassword(String userPassword) {
    this.userPassword = userPassword;
  }

  public Boolean getUserEnabled() {
    return userEnabled;
  }

  public void setUserEnabled(Boolean userEnabled) {
    this.userEnabled = userEnabled;
  }

  public Integer getUserBeans() {
    return userBeans;
  }

  public void setUserBeans(Integer userBeans) {
    this.userBeans = userBeans;
  }

  @Override
  public int hashCode() {
    int hash = 0;
    hash += (userMail != null ? userMail.hashCode() : 0);
    return hash;
  }

  @Override
  public boolean equals(Object object) {
    // TODO: Warning - this method won't work in the case the id fields are not set
    if (!(object instanceof JmbUsers)) {
      return false;
    }
    JmbUsers other = (JmbUsers) object;
    if ((this.userMail == null && other.userMail != null) || (this.userMail != null && !this.userMail.equals(other.userMail))) {
      return false;
    }
    return true;
  }

  @Override
  public String toString() {
    return "org.app.model.entities.JmbUsers[ userMail=" + userMail + " ]";
  }
  
}
